Apparatus and method for enhancing optical feature of workpiece, method for enhancing optical feature of workpiece through deep learning, and non-transitory computer-readable recording medium

ABSTRACT

The present invention provides an apparatus for enhancing an optical feature of a workpiece, comprising at least one variable image-taking device, at least one variable light source device, an image processing module and a control device. The variable image-taking device obtains images of the workpiece, and an external parameter and an internal parameter of which are adjustable. The variable light source device provides light source to the lighting the workpiece, wherein the variable light source device has an adjustable optical properties. The image processing module generates feature enhancement information according to the defect image information. The control device adjusts the external parameter, the internal parameter, and the optical properties according to the feature enhancement information and controls operations of the variable image-taking device and the variable light source device to obtain feature-enhanced images of the workpiece.

BACKGROUND OF THE INVENTION 1. Technical Field

The present invention relates to an apparatus and method for enhancingthe optical features of a workpiece, a method for enhancing the opticalfeatures of a workpiece through deep learning, and a non-transitorycomputer-readable recording medium. More particularly, the inventionrelates to an apparatus and method for enhancing the optical features ofa workpiece by intensifying the defects or flaws detected from theworkpiece, a method for achieving such enhancement through deeplearning, and a non-transitory computer-readable recording medium forimplementing the method.

2. Description of Related Art

Artificial intelligence (AI), also known as machine intelligence, refersto human-like intelligence demonstrated by a manmade machine viasimulating such human abilities as reasoning, comprehension, planning,learning, interaction, perception, moving, and object operation. Withthe development of technology, AI-related research has had preliminaryresults, and AI nowadays is capable of better performance than humansparticularly in areas involving a finite set of human abilities, such asin image recognition, speech recognition, and chess games.

Formerly, AI-based image analysis was carried out by machine learning,which involves analyzing image data and learning from the data in orderto determine or predict the state of a target object. Later, theadvancement of algorithms and the improvement of hardware performancebrought about major breakthroughs in deep learning. For instance, withthe help of artificial neural networks, human selection is no longerrequired in the machine training process of machine learning. Stronghardware performance and powerful algorithms make it possible to inputimages directly into an artificial neural network so that a machine canlearn on its own. Deep learning is expected to gradually supersedemachine learning and become the mainstream technique in machine visionand image recognition.

BRIEF SUMMARY OF THE INVENTION

It is an objective of the present invention to increase the rate atwhich a convolutional neural network can recognize the defects of aworkpiece. To this end, the defect features of images taken of aworkpiece are optically enhanced, and the enhanced images aretransferred to a deep-learning module to train the deep-learning module.

In order to achieve the above objective, the present invention providesan apparatus for enhancing an optical feature of a workpiece, whereinthe apparatus receives the workpiece and corresponding defect imageinformation from outside the apparatus, the apparatus comprising atleast one variable image-taking device, at least one variable lightsource device, an image processing module and a control device. Theimage-taking device obtains images of the workpiece in a working area,wherein the variable image-taking device has an external parameter andan internal parameter, which are adjustable. The variable light sourcedevice provides light source to the workpiece in the working area,wherein the optical properties of the variable light source device isadjustable. The image processing module generates feature enhancementinformation according to the defect image information. The controldevice adjusts the external parameter, the internal parameter, and/orthe optical properties according to the feature enhancement informationand controlling operation of the variable image-taking device and/or ofthe variable light source device to obtain feature-enhanced images ofthe workpiece.

Another objective of the present invention is to provide a method forenhancing an optical feature of a workpiece, comprising the steps of:receiving the workpiece and corresponding defect image information fromoutside; moving the workpiece to a working area; generating featureenhancement information according to the defect image information;adjusting an optical properties of a variable light source deviceaccording to the feature enhancement information, and then providinglight source to the workpiece in the working area by the variable lightsource device; and adjusting an external parameter and an internalparameter of a variable image-taking device according to the featureenhancement information, and then capturing images of the workpiece inthe working area by the variable image-taking device to obtainfeature-enhanced images of the workpiece.

Another objective of the present invention is to provide a method forenhancing an optical feature of a workpiece through deep learning,comprising the steps of: receiving the workpiece and correspondingdefect image information from outside; moving the workpiece to a workingarea; generating feature enhancement information according to the defectimage information; adjusting an optical properties of a variable lightsource device according to the feature enhancement information, and thenproviding light source to the workpiece in the working area by thevariable light source device; adjusting an external parameter and aninternal parameter of a variable image-taking device according to thefeature enhancement information, and then capturing images of theworkpiece in the working area by the variable image-taking device toobtain feature-enhanced images of the workpiece; normalizing thefeature-enhanced images to form training samples; and providing thetraining samples to a deep-learning model and thereby training thedeep-learning model to identify the defect image information

Furthermore, another objective of the present invention is to provide anon-transitory computer-readable recording medium, comprising a computerprogram, wherein the computer program performs the above methods afterbeing loaded into and executed by a controller.

The present invention can effectively enhance the presentation ofdefects or flaws in the images of a workpiece, thereby increasing therate at which a deep-learning model can recognize the defect or flawfeatures.

According to the present invention, images can be taken of a workpieceunder different lighting conditions and then input into a deep-learningmodel in order for the model to learn from the images. This also helpsincrease the defect or flaw feature recognition rate of thedeep-learning model.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS

FIG. 1 is a block diagram of an optical feature enhancement systemaccording to the invention.

FIG. 2 is a functional block diagram of the image processing module inthe present invention.

FIG. 3 is a schematic diagram of the light source control module in thevariable light source device of the present invention.

FIG. 4 is a schematic diagram of another preferred embodiment of thevariable light source device of the present invention.

FIG. 5 is a schematic diagram of another preferred embodiment of thevariable light source device of the present invention.

FIG. 6 is a perspective view of the variable image-taking device andmovable platform thereof of the present invention.

FIG. 7 is a side view of the variable image-taking device and movableplatform thereof of the present invention.

FIG. 8 is a block diagram showing how a convolutional neural network istrained.

FIG. 9 is the first parts of the flowchart of the disclosed method forenhancing the optical features of a workpiece.

FIG. 10 is the second parts of the flowchart of the disclosed method forenhancing the optical features of a workpiece.

DETAILED DESCRIPTION OF THE INVENTION

The details and technical solution of the present invention arehereunder described with reference to accompanying drawings. Forillustrative sake, the accompanying drawings are not drawn to scale. Theaccompanying drawings and the scale thereof are restrictive of thepresent invention.

A preferred embodiment of the present invention is described below withreference to FIG. 1, which is a block diagram of an optical featureenhancement system according to the invention.

The invention essentially includes an automated optical inspectionapparatus 10, at least one carrying device 20, and at least one opticalfeature enhancement apparatus 30. The carrying device 20 and the opticalfeature enhancement apparatus 30 are provided downstream of theautomated optical inspection apparatus 10. A workpiece that has beeninspected by the automated optical inspection apparatus 10 is carried bythe carrying device 20 to the working area of the optical featureenhancement apparatus 30. The optical feature enhancement apparatus 30provides additional lighting to enhance the defect features of theworkpiece, and images thus obtained are output to a convolutional neuralnetwork (CNN) system to conduct training process.

The automated optical inspection apparatus 10 includes an image takingdevice 11 and an image processing device 12 connected to the imagetaking device 11. The image taking device 11 photographs a workpiece toobtain images of the workpiece. In a preferred embodiment, the imagetaking device 11 may be an area scan camera or a line scan camera; thepresent invention has no limitation in this regard. The image processingdevice 12 is configured to generate defect image information byanalyzing and processing images. The defect image information includessuch information as the types and/or locations of defects.

The carrying device 20 is provided downstream of the automated opticalinspection apparatus 10 and is configured to carry a workpiece that hasbeen inspected by the automated optical inspection apparatus 10 to theworking area of the optical feature enhancement apparatus 30 in anautomatic or semi-automatic manner. In a preferred embodiment, thecarrying device 20 is composed of a plurality of working devices, andthe working devices work in concert with one another to transferworkpieces along a relatively short or relatively good path, keeping theworkpieces from collision or damage during the transferring or carryingprocess. More specifically, the carrying device 20 may be a conveyorbelt, a linearly movable platform, a vacuum suction device, a multi-axiscarrier, a multi-axis robotic arm, a flipping device, or the like, orany combination of the foregoing; the present invention has nolimitation in this regard.

The optical feature enhancement apparatus 30 is also provided downstreamof the automated optical inspection apparatus 10 and receives inspectedworkpieces from the carrying device 20. The optical feature enhancementapparatus 30 includes at least one variable image-taking device 31; atleast one variable light source device 32; an image processing module33; a control device 34 connected to the variable image-taking device31, the variable light source device 32, and the image processing module33; and a computation device 35 coupled to the control device 34. Thevariable light source device 32 and the variable image-taking device 31are provided in a working area in order to provide auxiliary lighting toand take further images of a workpiece respectively.

The variable light source device 32 is configured to provide lightsource to a workpiece and has adjustable optical properties. Morespecifically, the adjustable optical properties of the variable lightsource device 32 may include the intensity, projection angle, orwavelength of the output light.

In a preferred embodiment, the variable light source device 32 canprovide uniform light, collimated light, annular light, a point sourceof light, spotlight, area light, volume light, and so on. In anotherpreferred embodiment, the variable light source device 32 includes aplurality of lamp units provided respectively at different positions andangles (e.g., one at the front, one at the back, and several laterallight sources positioned at different angles respectively), wherein thelight sources of the light units at different corresponding angles canbe selectively activated by instructions of the control device 34 inorder to obtain images of a workpiece illuminated by different lightsources, or wherein the lamp unit can be moved by movable platforms todifferent positions in order to provide multi-angle or partial lighting.

In yet another preferred embodiment, the variable light source device 32can provide light of different wavelengths, such as white light, redlight, blue light, green light, yellow light, ultraviolet (UV) light,and laser light, so that the defect features of a workpiece can berendered more distinguishable by illuminating the workpiece with lightof one of the wavelengths.

In still another preferred embodiment, and by way of example only, thevariable light source device 32 can provide partial lighting to thedefects of a workpiece according to instructions of the control device34.

The variable image-taking device 31 is configured to obtain images of aworkpiece and has external parameters and internal parameters, which areadjustable. The internal parameters include, for example, the focallength, the image distance, the position where a camera's center ofprojection lies on the images taken, the aspect ratio of the imagestaken (expressed in numbers of pixels), and a camera's image distortionparameters. The external parameters include, for example, the locationand shooting direction of a camera in a three-dimensional coordinatesystem, such as a rotation matrix and a displacement matrix.

In a preferred embodiment, the variable image-taking device 31 may be anarea scan camera or a line scan camera, depending on equipment layoutrequirements; the present invention has no limitation in this regard.

The image processing module 33 is configured to generate featureenhancement information based on the defect image information. Morespecifically, the feature enhancement information may be a combinationof a series of control parameters, wherein the control parameters aregenerated according to the types and locations of defects and may be,for example, specific coordinates, a lighting strategy, or a processflow. In a preferred embodiment, a database of control parameters isestablished, and the desired control parameters can be found accordingto the types and locations of defects. The control parameters are outputto the control device 34 in order for the control device 34 to adjustthe output of the variable image-taking device 31 and of the variablelight source device 32 in advance and/or in real time.

The control device 34 is configured to adjust the aforesaid externalparameters, internal parameters, and/or optical properties according tothe feature enhancement information and control the operation of thevariable image-taking device 31 and/or of the variable light sourcedevice 32 so that feature-enhanced images can be obtained of aworkpiece.

In a preferred embodiment, the control device 34 essentially includes aprocessor and a storage unit connected to the processor. In thisembodiment, the processor and the storage unit may jointly form acomputer or processor, such as a personal computer, a workstation, amainframe computer, or a computer or processor of any other form; thepresent invention has no limitation in this regard. Also, the processorin this embodiment may be coupled to the storage unit. The processor maybe, for example, a central processing unit (CPU), a programmablegeneral-purpose or application-specific microprocessor, a digital signalprocessor (DSP), a programmable controller, an application-specificintegrated circuit (ASIC), a programmable logic device (PLD), or anyother similar device, or a combination of the above.

The computation device 35 is configured to execute a deep-learning modelafter loading the storage unit and then train the deep-learning modelwith feature-enhanced images so that the deep-learning model canidentify defect image information. The deep-learning model may be but isnot limited to a LeNet model, an AlexNet model, a GoogleNet model, aVisual Geometry Group (VGG) model, or a convolutional neural networkbased on (e.g., expanded from and with modifications made to) any of theaforementioned model.

Reference is now made to FIG. 2, which is a functional block diagram ofthe image processing module in the present invention.

The automated optical inspection apparatus 10 takes images of aworkpiece, marks the defect features of the images taken, and sends thedefect image information to the image processing module 33 in order forthe image processing module 33 to output feature enhancement informationto the control device 34, thereby allowing the control device 34 tocontrol the operation of the variable image-taking device 31 and/or ofthe variable light source device 32. The image processing module 33includes the following parts, named after their respective functions: animage analysis module 33A, a defect locating module 33B, and a defectarea calculating module 33C.

The image analysis module 33A is configured to verify the defectfeatures and defect types by analyzing the defect image information.More specifically, the image analysis module 33A performs apre-processing process (e.g., image enhancement, noise elimination,contrast enhancement, border enhancement, feature extraction, imagecompression, and image transformation) on an image obtained, applies avision software tool and algorithm to the to-be-output image toaccentuate the presentation of the defect features in the image, andcompares the processed image of the workpiece with an image of a masterslice to determine the differences therebetween, to verify the existenceof the defects, and preferably to also identify the defect features andthe defect types according to the presentation of the defects.

The defect locating module 33B is configured to locate the defectfeatures of a workpiece, or more particularly to find the positions ofthe defect features in the workpiece. More specifically, after the imageanalysis module 33A verifies the existence of defects, the defectlocating module 33B assigns coordinates to the location of each defectfeature in the image, correlates each set of coordinates with the itemnumber of the workpiece and the corresponding defect type, and storesthe aforesaid information into a database for future retrieval andaccess. It is worth mentioning that distinct features of the workpieceor of the workpiece carrier can be marked as reference points for thecoordinate system, or the boundary of the workpiece (in cases where theworkpiece is a flat object such as a panel or circuit board) can bedirectly used to define the coordinate system; the present invention hasno limitation in this regard.

The defect area calculating module 33C is configured to analyze thecovering area of each defect feature in the workpiece. Morespecifically, once the type and location of a defect are known, it isnecessary to determine the extent of the defect feature in the workpieceso that the backend optical feature enhancement apparatus 30 can takeimages covering the entire defect feature in the workpiece and determinethe covering area to be enhanced. The defect area calculating module 33Ccan identify the extent of each defect feature by searching for theboundary values of connected sections and then calculate the area of thedefect feature in the workpiece.

Any defect feature obtained through the foregoing procedure by the imageprocessing module 33 includes such information as the type and/orlocation of the defect.

As defect features present themselves better with certain types of lightsources than with others, the control device 34 of the optical featureenhancement apparatus 30 refers to the types of the defect featuresdetected (as can be found in the feature enhancement informationobtained, which includes such information as the types and location ofthe defects) in order to determine which type of light source should beprovided to the workpiece in the working area.

The storage unit of the control device 34 is prestored with a databasethat includes indices and output values corresponding respectively tothe indices. After obtaining the feature enhancement information fromthe image processing module 33, the control device 34 uses the featureenhancement information as an index to find the corresponding outputvalue, which is subsequently used to adjust the optical properties ofthe variable light source device 32.

The relationship between defect types and the optical properties of thevariable light source device 32 is described below by way of example.Please note that the following examples demonstrate only certain ways ofimplementing the present invention and are not intended to berestrictive of the scope of the invention.

If a defect feature provides a marked contrast in hue, color saturation,or brightness to the surrounding area and can be easily identifiedthrough an image processing procedure (e.g., binarization), it isfeasible to provide the workpiece surface with uniform light (or ambientlight) so that every part of the visible surface of the workpiece hasthe same brightness. Such defect features include, for example, metaldiscoloration, discoloration of the workpiece surface, black lines,accumulation of ink, inadvertently exposed substrate areas, bright dots,variegation, dirt, and scratches.

If a defect feature is an uneven area in the image, it is feasible toprovide the workpiece surface with collimated light from the side sothat an included angle is formed between the optical path and thevisible surface of the workpiece, allowing the uneven area in the imageto cast a shadow. Such defect features include vertical lines, bladestreaks, sanding marks, and other uneven workpiece surface portions.

If a defect feature is a flaw inside the workpiece or can reflect lightof a particular wavelength, it is feasible to provide a backlight at theback of the workpiece or illuminate the workpiece with a light sourcewhose wavelength can be adjusted to accentuate the defect in the image.Such defect features include, for example, mura, bright dots, and brightsub-pixels.

Aside from the above, different light source combinations can be used tohighlight different defect features in an image. The resultingfeature-enhanced images (i.e., images in which the defect features havebeen accentuated) are sent to the deep-learning model in the computationdevice 35 to train the model and thereby raise the recognition rate ofthe model.

The following paragraphs describe various embodiments of the variablelight source device 32 with reference to FIG. 3, which is a schematicdiagram of the light source control module in the variable light sourcedevice of the present invention.

According to a preferred embodiment as shown in FIG. 3, the variablelight source device 32 is composed of a plurality of lamp units, and theoperation of the lamp units is controlled by a light source controlmodule 321 connected or coupled to the lamp units. More specifically,the light source control module 321 includes a light intensity controlunit 32A, a light angle control unit 32B, and a light wavelength controlunit 32C.

The light intensity control unit 32A is configured to control the outputpower of one or a plurality of lamp units. The optical featureenhancement apparatus 30 can detect the state of ambient light and thencontrol the output power of the lamp units of the variable light sourcedevice 32 through the light intensity control unit 32A according to thedetection result.

The light angle control unit 32B is configured to control the lightprojection angles of the lamp units. In a preferred embodiment, the lampunits are directly set at different angles to target the working area,and the light angle control unit 32B will turn on the lamp units whosepositions correspond to instructions received from the control device34. In another preferred embodiment, carrying devices are provided tocarry the lamp units of the variable light source device 32 to thedesired positions to shed additional light on a workpiece. In yetanother preferred embodiment, the polarization property of each lampunit can be changed via an electromagnetic transducer module provided onan optical propagation medium, with a view to outputting light ofdifferent phases or polarization directions. The present invention hasno limitation on how the light angle control unit 32B is implemented.

The light wavelength control unit 32C is configured to control thevariable light source device 32 to output light so that the defects onthe surface of a workpiece can be accentuated by switching to a certainwavelength. Light provided by the variable light source device 32includes, for example, white light, red light, blue light, green light,yellow light, UV light, and laser light. The aforementioned light can beused to accentuate mura defects of a panel and defects that are hiddenin a workpiece but easily identifiable with particular light.

Please refer to FIG. 4 for a schematic diagram of another preferredembodiment of the variable light source device of the present invention.

As shown in FIG. 4, the light source control module 321 in thispreferred embodiment can be connected to a plurality of different lampunits in order for the lamp units to output different types of lightsources in response to different defect features. In this embodiment,the light source control module 321 is connected to an annular light L1,a sidelight L2, and a backlight L3. Based on instructions received fromthe control device 34, the light source control module 321 determinesthe light(s) to be turned on so that the corresponding light will beoutput to the workpiece P, allowing the variable image-taking device 31to obtain images of the workpiece P under that particular light.

Please refer to FIG. 5 for a schematic diagram of yet another preferredembodiment of the variable light source device of the present invention.

As shown in FIG. 5, the optical feature enhancement apparatus 30 furtherincludes a first movable platform 322 for carrying the variable lightsource device 32. The first movable platform 322 can move the variablelight source device 32 within the working area according to instructionsof the control device 34, thereby adjusting the optical properties ofthe variable light source device 32. This embodiment can be used topartially enhance certain areas of a workpiece and increase the contrastbetween the defect features of the workpiece and the surrounding areasso that images of the defect features stand out from the images taken.

The first movable platform 322 in this preferred embodiment may be amultidimensional linearly movable platform, a multi-axis robotic arm, orthe like; the present invention has no limitation in this regard.

The following paragraphs describe various embodiments of the variableimage-taking device 31 with reference to FIG. 6, which is a perspectiveview of the variable image-taking device and a second movable platformof the present invention, and FIG. 7, which is a side view of thevariable image-taking device and the second movable platform in FIG. 6.

In the preferred embodiment shown in FIG. 6 and FIG. 7, the variableimage-taking device 31 can adapt to the types or locations of thedefects of the workpiece P by being moved according to instructions ofthe control device 34 to a better image-taking position or angle from orat which the variable image-taking device 31 can obtain images of theworkpiece P. The optical feature enhancement apparatus 30 furtherincludes a second movable platform 311 for carrying the variableimage-taking device 31. The second movable platform 311 can move thevariable image-taking device 31 within the working area to adjust theexternal parameters and internal parameters of the variable image-takingdevice 31, thereby enabling the variable image-taking device 31 tophotograph the workpiece P in the optimal manner and produce enhancedimages of the defects. The second movable platform 311 in thisembodiment is a multidimensional linearly movable platform configured tobe moved in the X, Y, Z, and θ directions so as to adjust the relativepositions of, and the distance and angle between, the variableimage-taking device 31 and the workpiece P.

As shown in FIG. 6, the variable image-taking device 31 can be moved bythe linearly movable platform along the X and Y directions. Afterreceiving the location information of the defect features, the controldevice 34 controls the amounts by which the linearly movable platform isto be moved in the X and Y directions respectively, and the variableimage-taking device 31 will be moved accordingly and thus aimed at thedefect features in order to photograph the defect features.

In addition to moving the variable image-taking device 31 in the X and Ydirections, the linearly movable platform can control the position andimage-taking angle of the variable image-taking device 31 in the Zdirection. As shown in FIG. 7, the linearly movable platform canoptionally be provided with a lifting device 312 and a rotating device313. The lifting device 312 is configured to move upward and downwardwith respect to the linearly movable platform, thereby adjusting thedistance between the variable image-taking device 31 and the workpieceP. The rotating device 313 is configured to carry the variableimage-taking device 31, and the rotation angle θ of the rotating device313 is determined by instructions received from the control device 34and defines the image-taking angle of the variable image-taking device31.

Other than the foregoing methods, the control device 34 may adjust thefocus and image-taking position of the variable image-taking device 31via software or by an optical means in order to obtain feature-enhancedimages; the present invention has no limitation on the control method ofthe control device 34.

The apparatus described above will eventually obtain feature-enhancedimages, i.e., images in which the defect features are enhanced. Thefeature-enhanced images obtained will be normalized and then output tothe deep-learning model in the computation device 35 to train the model.Structurally speaking, the deep-learning model may be a LeNet model, anAlexNet model, a GoogleNet model, or a VGG model; the present inventionhas no limitation in this regard.

The training method of a convolutional neural network is described belowwith reference to FIG. 8, which is a block diagram showing how aconvolutional neural network is trained.

As shown in FIG. 8, feature-enhanced images obtained from the foregoingprocess are input into a computer device (e.g., the computation device35). The computer device uses the feature-enhanced images sequentiallyin a training process. Each feature-enhanced image includes two types ofparameters, namely input values input into the network (i.e., imagedata) and an anticipated output (e.g., non-defective, NG, defective, orother defect types). The input values go through the convolutional-layergroup 201, the rectified linear units 202, and the pooling-layer group203 of the convolutional neural network repeatedly for featureenhancement and image compression and are classified by the fullyconnected-layer group 204 according to weights, before theclassification result is output from the normalization output layer 205.A comparison module 206 compares the classification result (i.e.,inspection result) with the anticipated output and determines whetherthe former matches the latter. If no, the comparison module 206 outputsthe errors (i.e., differences) to a weight adjustment module 207 inorder to adjust the weights of the fully connected layers bybackpropagation. The steps described above are repeated until thetraining is completed.

The aforesaid process not only can increase the defect or flaw featurerecognition rate of the convolutional neural network effectively, butalso verifies the performance of the network repeatedly during theinspection process so that the trained device will eventually have ahigh degree of completion and a high recognition rate.

The method of the present invention for enhancing the optical featuresof a workpiece is described below with reference to FIG. 9 and FIG. 10,which are respectively the first and second parts of the flowchart ofthe disclosed method for enhancing the optical features of a workpiece.

As shown in FIG. 9 and FIG. 10, the disclosed method for enhancing theoptical features of a workpiece essentially includes the followingsteps:

To begin with, the workpiece is carried to the inspection area of theautomated optical inspection apparatus 10 for defect/flaw detection(step S11).

Then, the automated optical inspection apparatus 10 photographs theworkpiece with the image taking device 11 to obtain images of theworkpiece (step S12).

After obtaining the images of the workpiece, the image processing device12 of the automated optical inspection apparatus 10 processes the imagesto obtain defect image information of the images (step S13). The defectimage information includes such information as the types and/orlocations of defects.

The workpiece having completed the inspection is carried from theinspection area of the automated optical inspection apparatus 10 to theworking area of the optical feature enhancement apparatus 30 by thecarrying device 20, and the image processing module 33 receives thedefect image information from the image processing device 12 (step S14).

Feature enhancement information is subsequently derived from the defectimage information (step S15). The feature enhancement information may bea combination of a series of control parameters, wherein the controlparameters are generated according to the types and locations of thedefects.

After that, the optical properties of the variable light source device32 are adjusted according to the feature enhancement information, andthe variable light source device 32 projects light on the workpiece inthe working area accordingly to enhance the defect features of theworkpiece (step S16). More specifically, the optical properties of thevariable light source device 32 are adjusted according to the types ofthe defects, and the adjustable optical properties of the variable lightsource device 32 include the intensity, projection angle, or wavelengthof the light source.

Following that, the control device 34 controls the external parametersand internal parameters of the variable image-taking device 31 accordingto the feature enhancement information, and images are taken of theworkpiece in the working area to obtain feature-enhanced images of theworkpiece (step S17). More specifically, the control device 34 canadjust, among others, the position, angle, or focal length of thevariable image-taking device 31 according to the types of the defects.

Then, the control device 34 normalizes the feature-enhanced images toform training samples (step S18). Each training sample at least includesinput values and an anticipated output corresponding to the inputvalues.

The training samples are sent to a computer device (e.g., thecomputation device 35) and are input through the computer device into adeep-learning model, thereby training the deep-learning model how toidentify the defect image information (step S19).

The steps stated above can be carried out by way of a non-transitorycomputer-readable recording medium. Such a computer-readable recordingmedium may be, for example, a read-only memory (ROM), a flash memory, afloppy disk, a hard disk drive, an optical disc, a USB flash drive, amagnetic tape, a database accessible through a network, or any otherstorage medium that a person skilled in the art can easily think of ashaving similar functions.

In summary, the present invention can effectively enhance thepresentation of defects or flaws in the images of a workpiece, therebyincreasing the rate at which a deep-learning model can recognize thedefect or flaw features. In addition, according to the presentinvention, images can be taken of a workpiece under different lightingconditions and then input into a deep-learning model in order for themodel to learn from the images. This also helps increase the defect orflaw feature recognition rate of the deep-learning model.

The above is the detailed description of the present invention. However,the above is merely the preferred embodiment of the present inventionand cannot be the limitation to the implement scope of the presentinvention, which means the variation and modification according thepresent invention may still fall into the scope of the invention.

What is claimed is:
 1. An apparatus for enhancing an optical feature ofa workpiece, wherein the apparatus receives the workpiece andcorresponding defect image information from outside the apparatus, theapparatus comprising: at least one variable image-taking device forobtaining images of the workpiece in a working area, wherein thevariable image-taking device has an external parameter and an internalparameter, which are adjustable; at least one variable light sourcedevice for lighting the workpiece in the working area, wherein thevariable light source device has an adjustable optical properties; animage processing module for generating feature enhancement informationaccording to the defect image information; and a control device foradjusting the external parameter, the internal parameter, and/or theoptical properties according to the feature enhancement information andcontrolling operation of the variable image-taking device and/or of thevariable light source device to obtain feature-enhanced images of theworkpiece.
 2. The apparatus of claim 1, further comprising a computationdevice coupled to the control device, wherein the computation device isconfigured to execute a deep-learning model after loading a storageunit, and to identify the defect image information according to thefeature-enhance images.
 3. The apparatus of claim 2, wherein thedeep-learning model is a LeNet model, an AlexNet model, a GoogleNetmodel or a Visual Geometry Group (VGG) model.
 4. The apparatus of claim1, wherein the adjustable optical properties of the variable lightsource device include intensity, projection angle, or wavelength of thelight source.
 5. The apparatus of claim 4, wherein the variable lightsource device includes a plurality of lamp units provided respectivelyat different positions and angles.
 6. The apparatus of claim 4, whereinthe light provided by the variable light source device includes whitelight, red light, blue light, green light, yellow light, ultraviolet(UV) light, or laser light.
 7. The apparatus of claim 4, wherein thevariable light source device comprises a plurality of lamp units and alight source control module connected or coupled to the plurality oflamp units.
 8. The apparatus of claim 7, wherein the light sourcecontrol module includes: a light intensity control unit configured tocontrol an output power of one or a plurality of lamp units; a lightangle control unit configured to control light projection angles of thelamp units; and, a light wavelength control unit configured to controlthe variable light source device to output light of differentwavelengths.
 9. The apparatus of claim 1, wherein the defect imageinformation received by the image processing module includes typesand/or locations of defects.
 10. The apparatus of claim 1, furthercomprising one or a plurality of carrying device, configured to carrythe workpiece that has been inspected by an outer automated opticalinspection apparatus to the working area.
 11. The apparatus of claim 10,wherein the carrying device comprises a conveyor belt, a linearlymovable platform, a vacuum suction device, a multi-axis carrier, amulti-axis robotic arm, or a flipping device.
 12. The apparatus of claim1, further comprising a first movable platform for carrying the variablelight source device; wherein the first movable platform moves thevariable light source device within the working area, thereby adjustingthe optical properties of the variable light source device.
 13. Theapparatus of claim 12, wherein the first movable platform is amultidimensional linearly movable platform or a multi-axis robotic arm.14. The apparatus of claim 1, further comprising a second movableplatform for carrying the variable image-taking device; wherein thesecond movable platform moves the variable image-taking device withinthe working area to adjust the external parameters and the internalparameters of the variable image-taking device.
 15. The apparatus ofclaim 1, wherein the image processing module includes: an image analysismodule configured to verify defect features and defect types byanalyzing the defect image information; a defect locating moduleconfigured to locate the defect features of the workpiece to find thepositions of the defect features in the workpiece; and, a defect areacalculating module configured to analyze a covering area of the defectfeatures in the workpiece.
 16. A method for enhancing an optical featureof a workpiece, comprising the steps of: receiving the workpiece andcorresponding defect image information from outside; moving theworkpiece to a working area; generating feature enhancement informationaccording to the defect image information; adjusting an opticalproperties of a variable light source device according to the featureenhancement information, and then lighting the workpiece in the workingarea by the variable light source device; and adjusting an externalparameter and an internal parameter of a variable image-taking deviceaccording to the feature enhancement information, and then capturingimages of the workpiece in the working area by the variable image-takingdevice to obtain feature-enhanced images of the workpiece.
 17. Themethod of claim 16, further comprising the step: providing the featureenhancement information to a deep-learning model, and then training thedeep-learning model to identify the defect image information.
 18. Themethod of claim 17, wherein the step of training include: inputting theobtained feature-enhanced images into a computation device in order forthe computation device uses the feature-enhanced images sequentially ina training process; wherein each said feature-enhanced image comprisestwo types of parameters consisting of input value and an anticipatedoutput, wherein the input value is input into a convolutional neuralnetwork; processing the input values of each said feature-enhanced imagerepeatedly by a convolutional-layer group, a rectified linear unit, anda pooling-layer group of the convolutional neural network to achievefeature enhancement and image compression; classifying the processedinput values of each said feature-enhanced image by a fullyconnected-layer group of the convolutional neural network according toweights, and outputting a classification result of each saidfeature-enhanced image by a normalization output layer of theconvolutional neural network as an inspection result; comparing theinspection result and the anticipated output of each saidfeature-enhanced image by a comparison module to determine whether theinspection result matches the anticipated output; and outputting errorsto a weight adjustment module and adjusting the weights of the fullyconnected-layer group through backpropagation, by the comparison moduleif the inspection result does not match the anticipated output.
 19. Themethod of claim 16, wherein the step of adjusting the optical propertiesof the variable light source device includes adjusting intensity,projection angle, or wavelength of the light source.
 20. The method ofclaim 16, wherein the step of adjusting the external parameter and theinternal parameter of the variable image-taking device include adjustingan image-taking position, a focus position, or a focal length of thevariable image-taking device.
 21. The method of claim 16, wherein thestep of generating feature enhancement information according to thedefect image information further comprising: analyzing the defect imageinformation to verify defect features and defect types; locating thedefect features of a workpiece to find the positions of the defectfeatures in the workpiece; and, analyzing covering area of the defectfeatures in the workpiece.
 22. A method for enhancing an optical featureof a workpiece through deep learning, comprising the steps of: receivingthe workpiece and corresponding defect image information from outside;moving the workpiece to a working area; generating feature enhancementinformation according to the defect image information; adjusting anoptical properties of a variable light source device according to thefeature enhancement information, and then lighting the workpiece in theworking area by the variable light source device; adjusting an externalparameter and an internal parameter of a variable image-taking deviceaccording to the feature enhancement information, and then capturingimages of the workpiece in the working area by the variable image-takingdevice to obtain feature-enhanced images of the workpiece; normalizingthe feature-enhanced images to form training samples; and providing thetraining samples to a deep-learning model and thereby training thedeep-learning model to identify the defect image information.
 23. Anon-transitory computer-readable recording medium, comprising a computerprogram, wherein the computer program performs the method of claim 16after being loaded into and executed by a controller.